<?php
use core\Lib;

?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>{$title}</title>
	{:Lib::load("base")}
	<link rel="stylesheet" href="__UIROOT__/lib/login/css/form-elements.css">
  <link rel="stylesheet" href="__UIROOT__/lib/login/css/style.css">


</head>

<body class="">

        <!-- Top content -->
        <div class="top-content">

            <div class="inner-bg">
                <div class="container ">

                    <div class="row">
                        <div class="col-sm-8 offset-sm-2 text">
                            <h1><strong>{$title}</strong></h1>

                        </div>
                    </div>

                    <div  id="login" class="row">
                        <div class="col-sm-6 offset-sm-3">

                        	<div class="form-box">
	                        	<div class="form-top">
	                        		<div class="form-top-left">
	                        			<h3>登陆</h3>
	                            		<p>请使用账号和密码进行登陆</p>
	                        		</div>
	                        		<div class="form-top-right">
	                        			<i class="fa fa-lock"></i>
	                        		</div>
	                            </div>
	                            <div class="form-bottom">
				                    <form id="loginform" role="form" action="#" method="post" class="login-form" onsubmit="return do_login();">
				                    <input type="hidden" name="act" value="login">
				                    	<div class="form-group">
				                    		<label class="sr-only" for="user_login">账号</label>
				                        	<input type="text" name="username" id="user_login" placeholder="账号 ..." class="form-username form-control">
				                        </div>
				                        <div class="form-group">
				                        	<label class="sr-only" for="user_pass">密码</label>
				                        	<input type="password" name="password" id="user_pass" placeholder="密码 ..." class="form-password form-control">
				                        </div>


				                        <button type="submit" class="btn">登 陆 !</button>
				                    </form>
			                    </div>
		                    </div>

		                	<div class="social-login">


	                        </div>

                        </div>

                    </div>

                </div>
            </div>

        </div>

        <!-- Footer -->
        <footer>
        	<div class="container">
        		<div class="row">

        			<div class="col-sm-8 offset-sm-2">
        				<div class="footer-border"></div>
        				<p>
        				copyright @ 2018 谷发
        				</p>
        			</div>

        		</div>
        	</div>
        </footer>

        <!-- Javascript -->

        <script src="__UIROOT__/lib/login/js/jquery.backstretch.min.js"></script>


<script type="text/javascript">
function login_attempt_focus(){
	setTimeout( function(){ try{
	d = document.getElementById('user_login');
	d.focus();
	d.select();
	} catch(e){}
	}, 200);
}

login_attempt_focus();

function login_ajax(){
	APP.ajaxform('/admin/login/login','loginform',function(msg){
		if (msg.result){
			APP.goto("/admin");
		}else{
			APP.alert(msg.data);
		}

	});

	return false;
}
function do_login(){

	return login_ajax();
}



jQuery(document).ready(function() {
    /*
        Fullscreen background
    */
    $.backstretch("__UIROOT__/lib/login/img/backgrounds/1.jpg");

});
</script>

</body></html>
